package com.zw.pm.module.integrate.month;

import com.zw.pm.base.BaseController;
import com.zw.pm.common.JsonResult;
import com.zw.pm.module.integrate.daily.ProduceDailyModel;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Description: 生产日报查询 控制层
 *
 * @Author: China.sgl
 * @Date: 2019/9/16 09:11
 */
@Slf4j
@Controller
@RequestMapping("/integrate/month")
public class ProduceMonthController extends BaseController {

    @Autowired
    private ProduceMonthService produceMonthService;

    /**
     * 页面
     * 
     * @return 页面路径
     */
    @GetMapping
    @RequiresPermissions({"integrate:month"})
    public String project() {
        return "integrate/produceMonth/page";
    }

    /**
     * 列表
     * 
     * @return list
     */
    @ResponseBody
    @PostMapping("/list")
    @RequiresPermissions({"integrate:month"})
    public List<ProduceMonthModel> list(ProduceMonthModel produceMonthModel) {
        long start = System.currentTimeMillis();
//        startPage();
        List<ProduceMonthModel> list = produceMonthService.findProduceMonth(produceMonthModel);
        log.debug("生产日报列表查询用时（毫秒）" + (System.currentTimeMillis() - start));
        return list;
    }

}
